﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BusinessLogicLayer.DataObject
{
    public class Floor
    {
        public string Name { get; set; }
        public List<Room> Rooms { get; set; }
        public List<DataAccessLayer.Room> dRooms { get; set; }
        public List<ReserveRoom> ReserveRooms { get; set; }

        public Floor(DataAccessLayer.Floor Floor)
        {
            this.Name = Floor.Name;
            this.dRooms = (from u in Floor.Rooms orderby u.OrderBy ascending select u).ToList();
            this.Rooms = Room.Convert(dRooms);
        }

        public static List<Floor> Convert(List<DataAccessLayer.Floor> Floors)
        {
            return (Floors.ConvertAll(new Converter<DataAccessLayer.Floor, Floor>(p => (new Floor(p)))));
        }
    }
}
